package com.ewing.common.dto;

/**
 * 检查结果
 * 
 * @author tansonlam
 * @createDate 2016年5月23日
 * 
 */
public class CheckResult<T> {
    private boolean isSuccess;
    private String message;
    private T result;

    public static <T> CheckResult<T> ofSuccess(T result) {
        CheckResult<T> checkResult = new CheckResult<T>();
        checkResult.isSuccess = true;
        checkResult.result = result;
        return checkResult;
    }

    public static <T> CheckResult<T> ofFailure(String message) {
        CheckResult<T> checkResult = new CheckResult<T>();
        checkResult.message = message;
        return checkResult;
    }

    public boolean isSuccess() {
        return isSuccess;
    }

    public void setSuccess(boolean isSuccess) {
        this.isSuccess = isSuccess;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getResult() {
        return result;
    }

    public void setResult(T result) {
        this.result = result;
    }

}
